// Converted from UnityScript to C# at http://www.M2H.nl/files/js_to_c.php - by Mike Hergaarden
// Do test the code! You usually need to change a few small bits.

using UnityEngine;
using System.Collections.Generic;

public class UIHandler : MonoBehaviour {
	
	
public Game g;
public GUISkin skin;

//STUFF TO KEEP HERE
private string hudText = "Pick something Will Ya?";
int source1;
int source2;
int whoseturn;


//top row LEAVE THIS BE SEAN
private Rect chargeWheelRect1= new Rect(20,20,150,150);
private Rect chargeWheelRect2= new Rect(Screen.width-170,20,150,150);

//bottom row MESS WITH THIS SEAN
//private Rect chatRect= new Rect(10, Screen.height-(240+10),400,240);
//private Rect optionsRect= new Rect(Screen.width-(239+20+325+20),Screen.height-(150+10),239,150);
private Rect buttonRect= new Rect(Screen.width-(656),Screen.height-(182),640,166); //= new Rect(Screen.width-(325+30),Screen.height-(150+10),345,150);
private Rect hudRect= new Rect(16, Screen.height-42,320,32);
private Rect confirmRect= new Rect(68,Screen.height-(150),200,80);
	
	private Rect messageRect= new Rect(Screen.width/2 - 150 ,Screen.height/2 - 75,300,150);
	private bool messageEnabled = true;
	private string messageText = "Player 1's Turn!";
		
	private Rect Card1Rect= new Rect(0,16,160,50);
	private Rect Card2Rect = new Rect(160,16,160,50);
	private Rect Card3Rect = new Rect(320,16,160,50);
	private Rect Card4Rect = new Rect(480,16,160,50);
	private Rect Card5Rect = new Rect(0,66,160,50);
	private Rect Card6Rect = new Rect(160,66,160,50);
	private Rect Card7Rect = new Rect(320,66,160,50);
	private Rect Card8Rect = new Rect(480,66,160,50);
	private Rect LogicButtonRect = new Rect(0,116,160,50);
	private Rect PassionButtonRect = new Rect(160,116,160,50);
	private Rect EthicsButtonRect = new Rect(320,116,160,50);
	private Rect DeceptionButtonRect = new Rect(480,116,160,50);
	


	//EGO LABELS
	private Rect egoRect1= new Rect(175,20,100,30);
	private Rect egoRect2= new Rect(Screen.width-(175+100),20,100,30);

	//TOWER HEIGHT LABELS
	private Rect towerHeightRect1= new Rect(40,350,150,24);
	private Rect towerHeightRect2= new Rect(Screen.width-(40+150),350,150,24);
	

	
//KINDA NOT NEEDED?
/*
private Rect messageRect= new Rect(450,450,100,20);
private GUIStyle centerStyle=new GUIStyle();

	
private Rect timeStart;
private Rect timeElapsed;

private string messageText;
private int messageLength;

private Rect startTime;
private int restSeconds;
private int roundedRestSeconds;
private int displaySeconds;
private int displayMinutes;
private bool  timerEnable=false;
private bool  timerCheck=false;

int countDownSeconds=15;

private int passionCharge1=0;
private int ethicsCharge1=0;
private int logicCharge1=0;
private int deceptionCharge1=0;

private int passionCharge2=0;
private int ethicsCharge2=0;
private int logicCharge2=0;
private int deceptionCharge2=0;

void  ShowMessage ( string inMsg ,  int inTime  ){
	messageText=inMsg;
	messageLength=inTime;
	timeStart=Time.time;
	timeElapsed=Time.time;
	messageEnabled=true;
}

void  GetChargeNum ( int teamNum ,   string type  ){
	if(teamNum==1){
		if(type=="Passion"){
			return passionCharge1;
		}
		else if(type=="Ethics"){
			return ethicsCharge1;
		}
		else if(type=="Logic"){
			return logicCharge1;
		}
		else if(type=="Deception"){
			return deceptionCharge1;
		}
	}
	else if(teamNum==2){
		if(type=="Passion"){
			return passionCharge2;
		}
		else if(type=="Ethics"){
			return ethicsCharge2;
		}
		else if(type=="Logic"){
			return logicCharge2;
		}
		else if(type=="Deception"){
			return deceptionCharge2;
		}
	}
}
void  AddCharge ( int teamNum ,  string type  ){
	if (teamNum==1)
	{
		if (type=="Passion")
		{
			passionCharge1++;
			if(passionCharge1>2) passionCharge1=2;
			//print("New Charge: " + passionCharge1);
		}
		if (type=="Ethics")
		{
			ethicsCharge1++;
			if(ethicsCharge1>2) ethicsCharge1=2;
		}
		if (type=="Logic")
		{
			logicCharge1++;
			if(logicCharge1>2) logicCharge1=2;
		}
		if (type=="Deception")
		{
			deceptionCharge1++;
			if(deceptionCharge1>2) deceptionCharge1=2;
		}
	}
	if (teamNum==2)
	{
		if (type=="Passion")
		{
			passionCharge2++;
			if(passionCharge2>2) passionCharge2=2;
		}
		if (type=="Ethics")
		{
			ethicsCharge2++;
			if(ethicsCharge2>2) ethicsCharge2=2;
		}
		if (type=="Logic")
		{
			logicCharge2++;
			if(logicCharge2>2) logicCharge1=2;
		}
		if (type=="Deception")
		{
			deceptionCharge2++;
			if(deceptionCharge2>2) deceptionCharge1=2;
		}
	}
}		
void  LoseCharge ( int teamNum ,  string type  ){
	if (teamNum==1)
	{
		if (type=="Passion")
		{
			passionCharge1--;
			if(passionCharge1<0) passionCharge1=0;
		}
		if (type=="Ethics")
		{
			ethicsCharge1--;
			if(ethicsCharge1<0) ethicsCharge1=0;
		}
		if (type=="Logic")
		{
			logicCharge1--;
			if(logicCharge1<0) logicCharge1=0;
		}
		if (type=="Deception")
		{
			deceptionCharge1--;
			if(deceptionCharge1<0) deceptionCharge1=0;
		}
	}
	if (teamNum==2)
	{
		if (type=="Passion")
		{
			passionCharge2--;
			if(passionCharge2<0) passionCharge2=0;
		}
		if (type=="Ethics")
		{
			ethicsCharge2--;
			if(ethicsCharge2<0) ethicsCharge2=0;
		}
		if (type=="Logic")
		{
			logicCharge2--;
			if(logicCharge2<0) logicCharge1=0;
		}
		if (type=="Deception")
		{
			deceptionCharge2--;
			if(deceptionCharge2<0) deceptionCharge1=0;
		}
	}
}
*/
	

void  OnGUI (){
	/*buttonHandler1=this.gameObject.GetComponent("ButtonHandler1");
		
	centerStyle.alignment=TextAnchor.UpperCenter;
	centerStyle.normal.textColor=Color.white;
		
		GUI.Window(3,optionsRect,OptionsWindowUpdater,"OptionsWindow:Quit/Timer", skin.customStyles[6]);
		
		GUI.Button(chatRect,"Chat Window");
			
		timeElapsed+=Time.deltaTime;
		if (timeElapsed>timeStart+messageLength)
		{
			messageEnabled=false;
		}
		
	}
	*/
	GUI.Window(0,chargeWheelRect1,ChargeWheelUpdater1,"", skin.customStyles[0]); //ChargeWheelUpdater
	GUI.Window(1,chargeWheelRect2,ChargeWheelUpdater2,"", skin.customStyles[0]);
	
	if(messageEnabled)
	{
		GUI.Window(4,messageRect,MessageUpdater,"", skin.customStyles[2]);
	}
	else
	{
		GUI.Window(2,buttonRect,ButtonWindowUpdater,""); //, skin.customStyles[1]
		
		GUI.Label(hudRect,hudText);
		if (GUI.Button(confirmRect,"Confirm", skin.customStyles[7]))
		{
			if (source1 != 0 && whoseturn == 1)
			{
				hudText = "Play Something Will Ya";
				showGUIMessage("Player 2's Turn!");
				whoseturn = 2;
			}
			else if (source2 != 0 && whoseturn == 2)
			{
				hudText = "Play Something Will Ya";
				Card playcard1, playcard2;
				List<EffectActive> list1 = new List<EffectActive>();
				List<EffectActive> list2 = new List<EffectActive>();
		
				if (source1 < 9)
				{
					playcard1 = g.getPlayerOne().playCard(source1-1);
				}
				else
				{
					switch (source1)
					{
						case 9: 
							list1.Add(new EffectActive("BuildLogicBlockCommand",8,g.getPlayerOne()));
							playcard1 = new Card("A Logic Block","","",0,2,"", list1, new List<EffectPassive>());
							break;
						case 10: 
							list1.Add(new EffectActive("BuildEthicsBlockCommand",14,g.getPlayerOne()));
							playcard1 = new Card("An Ethics Block","","",0,-2,"", list1, new List<EffectPassive>());
							break;
						case 11: 
							list1.Add(new EffectActive("BuildPassionBlockCommand",20,g.getPlayerOne()));
							playcard1 = new Card("A Passion Block","","",0,-2,"", list1, new List<EffectPassive>());
							break;
						case 12: 
							list1.Add(new EffectActive("BuildDeceptionBlockCommand",20,g.getPlayerOne()));
							playcard1 = new Card("A Deception Block","","",0,2,"", list1, new List<EffectPassive>());
							break;
						default:
							playcard1 = g.nullCard;
							break;
					}
				}
				
				if (source2 < 9)
				{
					playcard2 = g.getPlayerTwo().playCard(source2-1);
				}
				else
				{
					switch (source2)
					{
						case 9: 
							list2.Add(new EffectActive("BuildLogicBlockCommand",8,g.getPlayerTwo()));
							playcard2 = new Card("A Logic Block","","",0,0,"", list2, new List<EffectPassive>());
							break;
						case 10: 
							list2.Add(new EffectActive("BuildEthicsBlockCommand",14,g.getPlayerTwo()));
							playcard2 = new Card("An Ethics Block","","",0,0,"", list2, new List<EffectPassive>());
							break;
						case 11: 
							list2.Add(new EffectActive("BuildPassionBlockCommand",20,g.getPlayerTwo()));
							playcard2 = new Card("A Passion Block","","",0,0,"", list2, new List<EffectPassive>());
							break;
						case 12: 
							list2.Add(new EffectActive("BuildDeceptionBlockCommand",20,g.getPlayerTwo()));
							playcard2 = new Card("A Deception Block","","",0,0,"", list2, new List<EffectPassive>());
							break;
						default:
							playcard2 = g.nullCard;
							break;
					}
				}
				g.runTurn(playcard1, playcard2);
				source1 = 0;
				source2 = 0;
				
				g.updateBuffs();
				showGUIMessage("Player 1's Turn!");
				whoseturn = 1;
			}	
		}
	}
	GUI.Label(egoRect1,"Player 1 Ego "+ g.getPlayerOne().getCurrentEgo());
	GUI.Label(egoRect2,"Player 2 Ego "+g.getPlayerTwo().getCurrentEgo());
	GUI.Label(towerHeightRect1,"Player 1 Tower Height: "+ g.getPlayerOne().getTower().getHeight());
	GUI.Label(towerHeightRect2,"Player 2 Tower Height: "+ g.getPlayerTwo().getTower().getHeight());
		
}
	
/*
 * DONT TOUCH THIS SEAN!!! 
 */
void  ChargeWheelUpdater1 ( int windowID  ){
	
	//PASSION
	if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.PASSION)==2){
		GUI.Label( new Rect(7,7,68,68),"",skin.customStyles[16]);
	}
	else if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.PASSION)==1){
		GUI.Label( new Rect(33,33,42,42),"",skin.customStyles[15]);
	}

	//ETHICS
	if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.ETHICS)==2){
		GUI.Label( new Rect(75,7,68,68),"",skin.customStyles[18]);
	}
	else if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.ETHICS)==1){
		GUI.Label( new Rect(75,33,42,42),"",skin.customStyles[17]);
	}
	
	//DECEPTION
	if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION)==2){
		GUI.Label( new Rect(7,75,68,68),"",skin.customStyles[20]);
	}
	else if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION)==1){
		GUI.Label( new Rect(33,75,42,42),"",skin.customStyles[19]);
	}
	
	
	if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.LOGIC)==2){
		GUI.Label( new Rect(75,75,68,68),"",skin.customStyles[14]);
	}
	else if(g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.LOGIC)==1){
		GUI.Label( new Rect(75,75,42,42),"",skin.customStyles[13]);
	}
	
}
void  ChargeWheelUpdater2 ( int windowId  ){
		
	if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.PASSION)==2){
		GUI.Label( new Rect(7,7,68,68),"",skin.customStyles[16]);
	}
	else if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.PASSION)==1){
		GUI.Label( new Rect(33,33,42,42),"",skin.customStyles[15]);
	}

	
	if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.ETHICS)==2){
		GUI.Label( new Rect(75,7,68,68),"",skin.customStyles[18]);
	}
	else if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.ETHICS)==1){
		GUI.Label( new Rect(75,33,42,42),"",skin.customStyles[17]);
	}
	
	
	if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION)==2){
		GUI.Label( new Rect(7,75,68,68),"",skin.customStyles[20]);
	}
	else if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION)==1){
		GUI.Label( new Rect(33,75,42,42),"",skin.customStyles[19]);
	}
	
	
	if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.LOGIC)==2){
		GUI.Label( new Rect(75,75,68,68),"",skin.customStyles[14]);
	}
	else if(g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.LOGIC)==1){
		GUI.Label( new Rect(75,75,42,42),"",skin.customStyles[13]);
	}
	
}

	
/*
 * MESS WITH ALL OF THIS SEAN
 */
void  ButtonWindowUpdater ( int windowId  ){
	if (whoseturn == 1)
	{
		List<Card> hand1 = g.getPlayerOne().getHand();
			
		if (hand1.Count > 0 && hand1[0] != null)
		{		
			if(GUI.Button(Card1Rect,hand1[0].getName(), skin.customStyles[8])){
				if ((int)(hand1[0].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 1;
					hudText = "Player 1 will play: " + hand1[0];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[0].getName();
				}
			}
		}
		if (hand1.Count > 1 && hand1[1] != null)
		{		
			if(GUI.Button(Card2Rect,hand1[1].getName(), skin.customStyles[8])){
				if ((int)(hand1[1].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 2;
					hudText = "Player 1 will play: " + hand1[1];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[1].getName();
				}
			}
		}
		if (hand1.Count > 2 && hand1[2] != null)
		{		
			if(GUI.Button(Card3Rect,hand1[2].getName(), skin.customStyles[8])){
				if ((int)(hand1[2].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 3;
					hudText = "Player 1 will play: " + hand1[2];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[2].getName();
				}
			}
		}
		if (hand1.Count > 3 && hand1[3] != null)
		{		
			if(GUI.Button(Card4Rect,hand1[3].getName(), skin.customStyles[8])){
				if ((int)(hand1[3].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 4;
					hudText = "Player 1 will play: " + hand1[3];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[3].getName();
				}
			}
		}
		if (hand1.Count > 4 && hand1[4] != null)
		{		
			if(GUI.Button(Card5Rect,hand1[4].getName(), skin.customStyles[8])){
				if ((int)(hand1[4].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 5;
					hudText = "Player 1 will play: " + hand1[4];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[4].getName();
				}
			}
		}
		if (hand1.Count > 5 && hand1[5] != null)
		{		
			if(GUI.Button(Card6Rect,hand1[5].getName(), skin.customStyles[8])){
				if ((int)(hand1[5].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 6;
					hudText = "Player 1 will play: " + hand1[5];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[5].getName();
				}
			}
		}
		if (hand1.Count > 6 && hand1[6] != null)
		{		
			if(GUI.Button(Card7Rect,hand1[6].getName(), skin.customStyles[8])){
				if ((int)(hand1[6].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 7;
					hudText = "Player 1 will play: " + hand1[6];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[6].getName();
				}
			}
		}
		if (hand1.Count > 7 && hand1[7] != null)
		{		
			if(GUI.Button(Card6Rect,hand1[7].getName(), skin.customStyles[8])){
				if ((int)(hand1[7].getCost() * g.getPlayerOne().getEgoCostRate()) < g.getPlayerOne().getCurrentEgo())
				{
					source1 = 8;
					hudText = "Player 1 will play: " + hand1[7];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand1[7].getName();
				}
			}
		}
		if (g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.LOGIC) > 1)
		{
			if(GUI.Button( LogicButtonRect,"Play Logic"))// , skin.customStyles[12]))	
			{
				source1 = 9;
				hudText = "Player 1 will build a Logic block";	
			}	
		}
		if (g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.PASSION) > 1)
		{
			if(GUI.Button( PassionButtonRect,"Play Passion", skin.customStyles[9]))
			{
				source1 = 11;
				hudText = "Player 1 will build a Passion block";		
			}
		}
		if (g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.ETHICS) > 1)
		{
			if(GUI.Button( EthicsButtonRect,"Play Ethics", skin.customStyles[10]))
			{
				source1 = 10;
				hudText = "Player 1 will build a Passion block";	
			}
		}
		if (g.getPlayerOne().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION) > 1)
		{
			if(GUI.Button( DeceptionButtonRect,"Play Deception", skin.customStyles[11]))
			{
				source1 = 12;
				hudText = "Player 1 will build a Deception block";
			}
		}
	}
	else
	{
		List<Card> hand2 = g.getPlayerTwo().getHand();
			

		
		if (hand2.Count > 0 && hand2[0] != null)
		{		
			if(GUI.Button(Card1Rect,hand2[0].getName(), skin.customStyles[8])){
				if ((int)(hand2[0].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 1;
					hudText = "Player 2 will play: " + hand2[0];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[0].getName();
				}
			}
		}
		if (hand2.Count > 1 && hand2[1] != null)
		{		
			if(GUI.Button(Card2Rect,hand2[1].getName(), skin.customStyles[8])){
				if ((int)(hand2[1].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 2;
					hudText = "Player 2 will play: " + hand2[1];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[1].getName();
				}
			}
		}
		if (hand2.Count > 2 && hand2[2] != null)
		{		
			if(GUI.Button(Card3Rect,hand2[2].getName(), skin.customStyles[8])){
				if ((int)(hand2[2].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 3;
					hudText = "Player 2 will play: " + hand2[2];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[2].getName();
				}
			}
		}
		if (hand2.Count > 3 && hand2[3] != null)
		{		
			if(GUI.Button(Card4Rect,hand2[3].getName(), skin.customStyles[8])){
				if ((int)(hand2[3].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 4;
					hudText = "Player 2 will play: " + hand2[3];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[3].getName();
				}
			}
		}
		if (hand2.Count > 4 && hand2[4] != null)
		{		
			if(GUI.Button(Card5Rect,hand2[4].getName(), skin.customStyles[8])){
				if ((int)(hand2[4].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 5;
					hudText = "Player 2 will play: " + hand2[4];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[4].getName();
				}
			}
		}
		if (hand2.Count > 5 && hand2[5] != null)
		{		
			if(GUI.Button(Card6Rect,hand2[5].getName(), skin.customStyles[8])){
				if ((int)(hand2[5].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 6;
					hudText = "Player 2 will play: " + hand2[5];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[5].getName();
				}
			}
		}
		if (hand2.Count > 6 && hand2[6] != null)
		{		
			if(GUI.Button(Card7Rect,hand2[6].getName(), skin.customStyles[8])){
				if ((int)(hand2[6].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 7;
					hudText = "Player 2 will play: " + hand2[6];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[6].getName();
				}
			}
		}
		if (hand2.Count > 7 && hand2[7] != null)
		{		
			if(GUI.Button(Card6Rect,hand2[7].getName(), skin.customStyles[8])){
				if ((int)(hand2[7].getCost() * g.getPlayerTwo().getEgoCostRate()) < g.getPlayerTwo().getCurrentEgo())
				{
					source2 = 8;
					hudText = "Player 2 will play: " + hand2[7];
				}
				else
				{
					hudText = "You do not have enough ego to play " + hand2[7].getName();
				}
			}
		}
		if (g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.LOGIC) > 1)
		{
			if(GUI.Button( LogicButtonRect,"Play Logic"))// , skin.customStyles[12]))	
			{
				source2 = 9;
				hudText = "Player 2 will build a Logic block";	
			}	
		}
		if (g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.PASSION) > 1)
		{
			if(GUI.Button( PassionButtonRect,"Play Passion", skin.customStyles[9]))
			{
				source2 = 11;
				hudText = "Player 2 will build a Passion block";		
			}
		}
		if (g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.ETHICS) > 1)
		{
			if(GUI.Button( EthicsButtonRect,"Play Ethics", skin.customStyles[10]))
			{
				source2 = 10;
				hudText = "Player 2 will build a Passion block";	
			}
		}
		if (g.getPlayerTwo().getCharges().getCharge(ChargeWheel.chargeType.DECEPTION) > 1)
		{
			if(GUI.Button( DeceptionButtonRect,"Play Deception", skin.customStyles[11]))
			{
				source2 = 12;
				hudText = "Player 2 will build a Deception block";
			}
		}
	}		
}

/*
void  OptionsWindowUpdater ( int windowId  ){
	if(timerEnable){	
		FIXME_VAR_TYPE guiTime= Time.time - startTime;

		restSeconds = countDownSeconds - (guiTime);

		//display messages or whatever here -->do stuff based on your timer
		if (restSeconds == 60) {
			print ("One Minute Left");
		}
		if (restSeconds == 0) {
			print ("Time is Over");
			timerEnable=false;
			
			//do stuff here
		}

		//display the timer
		roundedRestSeconds = Mathf.CeilToInt(restSeconds);
		displaySeconds = roundedRestSeconds % 60;
		displayMinutes = roundedRestSeconds / 60; 

		text = String.Format ("{0:00}:{1:00}", displayMinutes, displaySeconds); 
		GUI.Label ( new Rect(200, 75, 75, 30), text);
	}
	GUI.Button( new Rect(20,70,100,30),"Tie", skin.customStyles[7]);
	if(GUI.Button( new Rect(20,110,100,30),"Forfeit", skin.customStyles[7])){
		this.gameObject.GetComponent("GameHandler").player1forfeitCheck=true;
	}
	GUI.Label( new Rect(140,30,50,30),"Timer:");
}

void  enableTimer (){
    startTime = Time.time;
	timerEnable=true;
	Debug.Log("Starting Timer");
	
}
*/

void  MessageUpdater ( int windowID )
{
	GUI.Label(new Rect(20,20,260,80), messageText);
	
	if(GUI.Button(new Rect(50,100,200,25),"OK", skin.customStyles[4]))
	{
		messageEnabled = false;
	}
	
}

void showGUIMessage (string text)
{
	messageEnabled = true;
	messageText = text;
}

}